1. Field of the Invention
The present invention relates generally to computer rendering of graphics, and more particularly to rendering by particle tracing in a computer aided design (CAD) environment.
2. Related Art
Rendering is the process of depicting a realistic three-dimensional (3D) model on a computer through the display of shaded surfaces applied to an outline drawing. Images produced via rendering are photo-realistic images. These photo-realistic images may be used to simulate the appearance of a proposed architectural design and to create interactive walkthroughs and animations for the proposed design. Ray tracing, radiosity and particle tracing are among the techniques used to render photo-realistic images.
Ray tracing is a photo-realistic rendering method in which an image is generated by simulating the reflections of light rays in a 3D scene. In the real world, light rays are emitted by one or many light sources and reflect off objects until they finally reach the eye. On a computer, it is often more efficient to trace rays from the eye, rather than from the light sources. This can save a significant amount of time by not following rays from light sources to surfaces that are never seen in the image.
Ray tracing follows rays backward from the eye into the scene, determining what is visible. Rays of light are traced from the viewer's eye (the camera position) through each pixel that comprises the image in the view.
Tracing a ray involves testing all objects in a scene for intersection with that ray. For these initial rays, often referred to as primary rays or eye rays, the nearest, intersection along each ray must be computed and the entire design must be examined to find the nearest of all the intersections along the ray. Hidden surface removal is performed by this procedure. Once it is determined what surfaces are visible, the illumination and shading of the visible objects is computed.
The shading of the visible surface is computed for each pixel. The color of the surface is composed of three components—ambient, local, and global illumination—which are added together.
Ambient illumination is surface lighting not directly attributed to any particular light source. Ambient light brightens a scene in areas where there is little or no lighting.
Local illumination is surface shading directly attributed to light sources. Local illumination is made up of diffuse and specular components. The diffuse component is the light that directly strikes a surface. It is view-independent. The specular component creates a bright highlight in the reflected direction of the light on objects with glossy surfaces. Specular highlights are view-dependent.
Global illumination is shading on a surface due to secondary (global) effects such as reflections and transparency.
To determine the illumination a surface receives from the reflected and refracted directions, secondary rays are traced in those directions. For efficiency, rays are only traced if the surface is actually reflective or transparent. Each reflected or transmitted ray is treated as a primary ray in that the nearest intersection along the ray must be computed. Similarly, the surfaces that these rays “see” must be shaded as described above. This process is repeated recursively until a defined limit is reached or the accumulated reflectivity or transparency drops below a given threshold.
Radiosity is another technique used in rendering. Radiosity is defined in the terminology of physics as the total power leaving a point on a surface, per unit area on the surface. In the context of rendering, “power” is light energy.
Radiosity solving is a sophisticated technique that calculates the light that is reflected between diffuse surfaces. It can be used to demonstrate effects such as color bleeding, where one colored surface lends a tint to another nearby surface, and light dispersion, the reflection of indirect light onto other surfaces in a scene. In comparison, ray tracing simulates the specular reflection of rays of light in a scene.
Radiosity solving, unlike ray tracing, is not a rendering technique on its own, it merely generates a lighting solution that in turn can be rendered. In fact, radiosity solving and ray tracing capabilities can be used together to produce realistic images with the best qualities of both methods. Radiosity solving operates as a rendering pre-process that computes the global, view independent (diffuse) lighting solution. Ray tracing uses this radiosity solution to render a view dependent image, adding specular highlights and reflections.
The radiosity solving process produces useful intermediate solutions in a short amount of time. It then automatically and continuously refines them into the final solution. This makes it possible to display intermediate results so that a user can then decide when the solution is satisfactory and stop the calculations.
Particle tracing, like radiosity solving, calculates a lighting solution, which is then rendered. Because a total lighting solution is calculated, particle traced solutions are view independent. That is, once a particle traced solution of a model is present in memory, different views of the model can be rendered using the current lighting solution. These subsequent renderings are much quicker because the existing lighting solution is used.
Where required, these views can be ray traced to display caustics. Caustics are the lighting effects caused by light reflected off surfaces or refracted through transparent objects, such as light reflected off a mirror or focused though a lens. A caustic reflection differs from a ray-traced reflection in that the caustic reflection adds light to the surface receiving the caustic, whereas the ray-traced reflection just shows what the viewer would see. Examples of caustics include specular highlights, transparency, refraction and reflection.
When a model is ray traced, a picture of what can be seen from the view camera's eyepoint is produced. Reflections in shiny elements, and refraction through transparent objects are visible. The effects of diffuse and specular light reflecting, or “bouncing,” off these elements and adding to the lighting of other elements in the model are not visible. Both radiosity and particle tracing account for the effects of diffuse reflection of light, but only particle tracing accounts for the specular reflection of light as well. Both radiosity and particle tracing rendering modes may use ray tracing of the final display in order to view the reflection of objects in shiny surfaces, and the refraction of light through transparent objects.
Whereas, ray tracing traces the path of light rays from the eyepoint back into the scene, particle tracing calculates the path of light particles as they reflect around the scene.
Particle tracing works by calculating the paths of light particles as they are emitted from light sources and are reflected and transmitted throughout the scene. The process typically occurs in three distinct phases: particle processing, meshing, and rendering. In conventional particle tracing, only after the particle processing and meshing phases are performed can rendering be done.
The three steps conventional particle tracing systems perform to render images are shown in FIG. 1. Starting with an un-rendered scene, in step 102, conventional systems first perform particle processing in step 104, also known as particle shooting. During the particle processing step, light particles are distributed among the light sources, and then the paths of the light particles from the light sources are traced through the scene, interacting with the surfaces encountered along the way.
In step 106, the illumination of the surfaces the particles encounter is determined. This is referred to as meshing, because this illumination information is stored at select “mesh” points on each surface. After meshing is performed for all the surfaces in the scene, whether visible in a selected view or not, the scene is rendered in step 108 using the illumination information from the meshing step 106, resulting in a rendered image at 110. Only after a full solution is computed in the particle shooting and meshing phases can an image be rendered. As meshing is performed for all surfaces in the entire scene, much time can be wasted processing images that are not seen by a user.
These conventional rendering processes work well for small amounts of data, but large or complex scenes can take hours or days to process before the image can be seen. This is a disadvantage for the user, who must wait for the final rendering. Moreover, if the resulting scene is not what the user wanted, then the process must be started over, wasting more time.
Additionally, CAD scenes comprise a number of different views. Because the scenes represent three-dimensional space, a user can view a scene from a number of different perspectives and can zoom into and out of a particular perspective. Conventional rendering based on particle tracing requires the user to wait for the entire scene to be rendered in order to see just one view.
Thus, there is a need for an improved rendering process that generates photorealistic images, while overcoming the shortcomings of conventional solutions and providing a solution with shortened processing time.